package com.example.kafka.handler;

import com.example.enums.EventType;
import com.example.kafka.KafkaEvent;
import com.example.kafka.data.PrivateMsgEventData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class PrivateMsgEventHandler implements EventHandler<PrivateMsgEventData> {

    @Override
    public boolean validateEvent(KafkaEvent event) {
        return true;
    }

    @Override
    public void handleEvent(KafkaEvent event) {
        log.info("Handling event of type: {} with data: {}", event.getEventType(), event.getData());
    }

    @Override
    public EventType getEventType() {
        return EventType.PrivateMsg;
    }

    @Override
    public Class<PrivateMsgEventData> getEventDataType() {
        return PrivateMsgEventData.class;
    }
}
